home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / getcmdle.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  588 b   |  35 lines

  1. /*
  2. \funcref{getcmdlen}{int getcmdlen (\params)}
  3.     {
  4.         {char} {**cmd} {{\em argv}-like array}
  5.     }
  6.     {length of command line corresponding to {\em cmd}}
  7.     {}
  8.     {addcmd()}
  9.     {getcmdle.c}
  10.     {
  11.  
  12.         The length of the command, as represented by {\em cmd}, is returned.
  13.         See {\em addcmd()} for a description of the {\em cmd} array.
  14.  
  15.     }
  16. */
  17.  
  18. #include "icm-exec.h"
  19.  
  20. int getcmdlen (cmd)
  21. char **cmd;
  22. {
  23.     register int
  24.         i,
  25.         len;
  26.  
  27.     len = 0;
  28.     for (i = 0; cmd [i]; i++)
  29.     {
  30.         len += strlen (cmd [i]);
  31.         len++;
  32.     }
  33.  
  34.     return (len);
  35. }